package com.wondersgroup.fjzlpt.org.controller.view.gzt;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.wondersgroup.fjzlpt.org.util.ControllerCommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.web.utils.RequestUtils;
import com.quick.framework.boot.web.wapper.QuickPrincipal;
import com.wondersgroup.fjzlpt.org.service.inter.gzt.GztService;
import com.wondersgroup.fjzlpt.org.service.inter.jtqy.JtqyService;


/**
 * 工作台
 * @author gzb   
 * 2017年5月22日
 */
@Controller
@RequestMapping("gzt")
public class GztController {

	@Autowired
	private GztService gztService;
	@Autowired
	private JtqyService jtqyService;
	
	@RequestMapping("index.html")
	public String toIndex(HttpServletRequest request){
		Map map = ControllerCommonUtil.getQueryTdxxParams(request);
		JSONArray TDXX = jtqyService.queryTdxxAll(map);
		request.setAttribute("tdxxArr", TDXX);
		return "gzt/index";
	}
	
	@RequestMapping("yqyModel.html")
	public String yqyModel(){
		return "gzt/yqyModel";
	}
	
	@RequestMapping("yxqyModel.html")
	public String yxqyModel(){
		return "gzt/yxqyModel";
	}
	
	
	@RequestMapping("/detail.html")
	public String detail(HttpServletRequest request)
	{
		Map map = RequestUtils.GetParameterMap(request);
		JSONObject data = jtqyService.cygxQuery(map);
		request.setAttribute("data", data);
		
		return "jtqy/" + map.get("to").toString();
	}
	
}
